import React, { useContext } from 'react'
import Child from './Child'
import { Context } from './App'

export default function Parent() {
  // 接受 Context 对象
  // 返回值：就是提供的数据
  const value = useContext(Context)
  return (
    <div>
      Parent: {value.count}
      <button onClick={value.changeCount}>修改</button>
      <hr />
      <Child />
    </div>
  )
}
